﻿using System.Drawing;
using MindFusion.Diagramming;
using MindFusion.Drawing;
using Pen = System.Drawing.Pen;
using Kernel;

namespace ElectionAlgoritmForm.Diagramming
{
    class Relation:DiagramLink
    {
        public string LinkTitle { get; set; }

        public Relation(Diagram parent):base(parent) { }
        public Relation(Diagram parent, DiagramNode origin, DiagramNode destination, string title) : base(parent, origin, destination) 
        {
            LinkTitle = title;
        }
        public Relation(Diagram parent, DiagramNode origin, PointF destination) : base(parent, origin, destination) { }
        public Relation(Diagram parent, PointF origin, DiagramNode destination) : base(parent, origin, destination) { }
        public Relation(Diagram parent, PointF origin, PointF destination) : base(parent, origin, destination) { }
        public Relation(DiagramLink prototype, DiagramNode origin, DiagramNode destination) : base(prototype, origin, destination) { }

        public override void Draw(IGraphics graphics, RenderOptions options)
        {
            this.Text = LinkTitle;
            if(Selected)
                graphics.DrawLine(new Pen(Color.White, 3), ControlPoints[0].X, ControlPoints[0].Y, ControlPoints[1].X, ControlPoints[1].Y);
            base.Draw(graphics, options);
        }

        public override void DrawShadow(IGraphics graphics, RenderOptions options)
        {
            
        }
    }
}
